package com.lanou3g.code0510.anno;

/**
 * Created by dllo on 18/5/10.
 */
//Servlet就是通过这种方式,来获取注解里的名字与路径
public class Main {
    public static void main(String[] args) {
        MyServlet myServlet = new MyServlet();
        //获取注解里面的值(需要用反射获取注解里的值)
        Class clazz = myServlet.getClass();
        //获取注解
        MyAnno anno = (MyAnno) clazz.getAnnotation(MyAnno.class);
        String name = anno.name();
        String path = anno.path();
        System.out.println(name);
        System.out.println(path);
    }
}
